﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        
        $(function () {
            //$.getJSON(uri)
            //    .done(function (data) {
            //      // On success, 'data' contains a list of products.
            //      $.each(data, function (key, item) {
            //          // Add a list item for the product.
            //          $('<li>', { text: formatItem(item) }).appendTo($('#content'));
            //      });
            //});
        });
        function formatItem(item) {
            return item.Id + ': $' + item.TypeName;
        }

        function find() {
            var id = $('#entityId').val();
            var uri = '../api/GoodsType/Get/' + id;
            $.ajax({
                url: uri,
                type: "GET",
                dataType: "json",
                success: function (data) {
                    $('#content').text(formatItem(data));
                },
                error: function (e) {
                    
                }
            });
        }
    </script>
	<meta charset="utf-8" />
</head>
<body>
    <div>
        <ul id="content" />
    </div>
    <div>
        <h2>Search by ID</h2>
        <input type="text" id="entityId" size="5" />
        <input type="button" value="Search" onclick="find();" />
    </div>
</body>
</html>
